import Vue from 'vue'
import Router from 'vue-router'
// import withdraw from '@/components/account/withdraw';
// import two from '@/components/account/two';
// import Mindex from '@/components/mobile/mindex';

Vue.use(Router);
const HelloWorld = r => require.ensure([], () => r(require('@/components/home/HelloWorld')), 'chunkname1')
const about = r => require.ensure([], () => r(require('@/components/about/about')), 'chunkname1')
const ourplatform = r => require.ensure([], () => r(require('@/components/OurPlatform/OurPlatform')), 'chunkname2')
const activity = r => require.ensure([], () => r(require('@/components/activity/activity')), 'chunkname2')
// 活动中的内容页4个
const monkey = r => require.ensure([], () => r(require('@/components/activity/monkey')), 'chunkname2')
const maldives = r => require.ensure([], () => r(require('@/components/activity/maldives')), 'chunkname2')
const chicken = r => require.ensure([], () => r(require('@/components/activity/chicken')), 'chunkname2')
const fxup = r => require.ensure([], () => r(require('@/components/activity/fxup')), 'chunkname2')
const hk = r => require.ensure([], () => r(require('@/components/activity/hk')), 'chunkname2')
const forex = r => require.ensure([], () => r(require('@/components/forex/forex')), 'chunkname2')
const account = r => require.ensure([], () => r(require('@/components/account/account')), 'chunkname2')
const partner = r => require.ensure([], () => r(require('@/components/partner/partner')), 'chunkname2')
const login = r => require.ensure([], () => r(require('@/components/login/login')), 'chunkname2')
const agencylogin = r => require.ensure([], () => r(require('@/components/agencylogin/agencylogin')), 'chunkname2')
const faq = r => require.ensure([], () => r(require('@/components/faq/faq')), 'chunkname2')
const simulate = r => require.ensure([], () => r(require('@/components/simulate/simulate')), 'chunkname2')
const openaccount = r => require.ensure([], () => r(require('@/components/openaccount/openaccount')), 'chunkname2')
const TradingGuide = r => require.ensure([], () => r(require('@/components/TradingGuide/TradingGuide')), 'chunkname2')
const klogin = r => require.ensure([], () => r(require('@/components/login//klogin')), 'chunkname2')
const ib = r => require.ensure([], () => r(require('@/components/partner/ib')), 'chunkname2')
const advantage = r => require.ensure([], () => r(require('@/components/partner/advantage')), 'chunkname2')
const organization = r => require.ensure([], () => r(require('@/components/partner/organization')), 'chunkname2')
const type = r => require.ensure([], () => r(require('@/components/account/type')), 'chunkname2')
const withdraw = r => require.ensure([], () => r(require('@/components/account/withdraw')), 'chunkname2')
const two = r => require.ensure([], () => r(require('@/components/account/two')), 'chunkname2')

// 交易指南中的二级页面
// 外汇基础知识
const knowledge = r => require.ensure([], () => r(require('@/components/guide/knowledge')), 'chunkname2')
// 基础知识1-11
const fxone = r => require.ensure([], () => r(require('@/components/guide/fxone')), 'chunkname2')
const fxtwo = r => require.ensure([], () => r(require('@/components/guide/fxtwo')), 'chunkname2')
const fxthree = r => require.ensure([], () => r(require('@/components/guide/fxthree')), 'chunkname2')
const fxfour = r => require.ensure([], () => r(require('@/components/guide/fxfour')), 'chunkname2')
const fxfive = r => require.ensure([], () => r(require('@/components/guide/fxfive')), 'chunkname2')
const fxsix = r => require.ensure([], () => r(require('@/components/guide/fxsix')), 'chunkname2')
const fxseven = r => require.ensure([], () => r(require('@/components/guide/fxseven')), 'chunkname2')
const fxeight = r => require.ensure([], () => r(require('@/components/guide/fxeight')), 'chunkname2')
const fxnine = r => require.ensure([], () => r(require('@/components/guide/fxnine')), 'chunkname2')
const fxten = r => require.ensure([], () => r(require('@/components/guide/fxten')), 'chunkname2')
const fxeleven = r => require.ensure([], () => r(require('@/components/guide/fxeleven')), 'chunkname2')

// 外汇交易优势
const fxadvantage = r => require.ensure([], () => r(require('@/components/guide/advantage')), 'chunkname2')
// 外汇交易指南(风险控制)
const fxguide = r => require.ensure([], () => r(require('@/components/guide/basicguide')), 'chunkname2')
// 外汇交易指南(风险运作)
const fxrun = r => require.ensure([], () => r(require('@/components/guide/fxrun')), 'chunkname2')
// 外汇交易指南中的基础分析
const basicanalysis = r => require.ensure([], () => r(require('@/components/guide/basicanalysis')), 'chunkname2')
// 外汇交易指南中的技术分析
const jishuanalysis = r => require.ensure([], () => r(require('@/components/guide/technicalanalysis')), 'chunkname2')
// 外汇交易指南中的图表基本类型
const icontype = r => require.ensure([], () => r(require('@/components/guide/icontype')), 'chunkname2')
// 外汇词汇
const fxwords = r => require.ensure([], () => r(require('@/components/guide/fxwords')), 'chunkname2')

const routes = [
  {
    path: '/', //首页
    component: HelloWorld
  },
  {
    path: '/hello', //首页
    name: 'Hello',
    component: HelloWorld
  },
  {
    path: '/about', //关于我们
    name: 'about',
    component: about
  },
  {
    path: '/ourplatfrom', //我们的平台
    component: ourplatform
  },
  {
    path: '/activity',  //市场活动中心
    component: activity
  },
  {
    path: '/fxmonkey',  //活动中心---猴
    component: monkey
  },
  {
    path: '/fxmaldives',  //活动中心---马尔代夫
    component: maldives
  },
  {
    path: '/fxchicken',  //活动中心---鸡
    component: chicken
  },
  {
    path: '/fxup',  //活动中心---莺春起舞
    component: fxup
  },
  {
    path: '/fxhk',  //活动中心---香港
    component: hk
  },
  {
    path: '/forex',   //外汇交易需知
    component: forex
  },
  {
    path: '/account',  //账户类型
    name: 'account',
    component: account,
    children: [
      {
        path: '/',
        component: type
      },
      {
        path: '/withdraw',
        component: withdraw
      },
      {
        path: '/two',
        component: two
      }
    ]
  },
  {
    path: '/partner',   // 合作伙伴
    component: partner,
    children: [
      {
        path: '/',
        component: advantage
      },
      {
        path: '/ib',
        component: ib
      },
      {
        path: '/organization',
        component: organization
      }
    ]
  },
  {
    path: '/login',  //客户登录
    component: login
  },
  {
    path: '/agencylogin',  // 代理登录
    component: agencylogin
  },
  {
    path: '/faq',  //常见问题
    component: faq
  },
  {
    path: '/simulate',  //模拟账户
    component: simulate
  },
  {
    path: '/openaccount',  //立即开户
    component: openaccount
  },
  {
    path: '/TradingGuide',  //交易指南
    component: TradingGuide
  },
  {
    path: '/login/klogin',  //客户登录选项卡
    component: klogin
  },
  {
    path: '/fxknowledge', // 外汇基础知识
    component: knowledge
  },
  {
    path: '/fxone', // 外汇基础知识1-11
    component: fxone
  },
  {
    path: '/fxtwo', // 外汇基础知识1-11
    component: fxtwo
  },
  {
    path: '/fxthree', // 外汇基础知识1-11
    component: fxthree
  },
  {
    path: '/fxfour', // 外汇基础知识1-11
    component: fxfour
  },
  {
    path: '/fxfive', // 外汇基础知识1-11
    component: fxfive
  },
  {
    path: '/fxsix', // 外汇基础知识1-11
    component: fxsix
  },
  {
    path: '/fxseven', // 外汇基础知识1-11
    component: fxseven
  },
  {
    path: '/fxeight', // 外汇基础知识1-11
    component: fxeight
  },
  {
    path: '/fxnine', // 外汇基础知识1-11
    component: fxnine
  },
  {
    path: '/fxten', // 外汇基础知识1-11
    component: fxten
  },
  {
    path: '/fxeleven', // 外汇基础知识1-11
    component: fxeleven
  },
  {
    path: '/fxadvantage', // 外汇交易优势
    component: fxadvantage
  },
  {
    path: '/fxguide', // 外汇交易指南(风险控制)
    component: fxguide
  },{
    path: '/fxrun', // 外汇交易指南(风险运作)
    component: fxrun
  },{
    path: '/fxbasic', // 外汇基本分析中的基础分析
    component: basicanalysis
  },{
    path: '/fxanalysis', // 外汇基本分析中的技术分析
    component: jishuanalysis
  },{
    path: '/fxicontype', // 外汇基本分析中的图表基本类型
    component: icontype
  },{
    path: '/fxwords', // 外汇词汇
    component: fxwords
  }
]

const router = new Router({
  routes,
  linkActiveClass: 'active',
});

export default router;
